import { request,getCookie } from '@inbiz/utils';


// 获取搜索日志列表
export const getSearchLogList=(params?: {
  pageIndex: number;
  pageSize: number;
})=>{
  const token = getCookie('token');
  return request(`/search/IndexSystem/GetSearchKeyWordLogList?token=${token}`,{
    method: 'POST',
    requestType: 'form',
    data: {
      ...params
    },
  })
}

// 删除搜索日志记录
export const delSearchLog=(params:any)=>{
  return request(`/search/IndexSystem/DeleteSearchKeyWordLog`,{
    method: 'POST',
    requestType: 'form',
    data: {
      ids:params
    },
  })
}

// 获取问题分析日志列表 
export const getLogPagingList=(params: {
  pageIndex: number;
  pageSize: number;
})=>{
  return request(`/search/IndexSystem/GetLogPagingList`,{
    method: 'POST',
    requestType: 'form',
    data: {
      ...params
    },
  })
}

// 删除问题分析日志记录
export const delAnalyseLog=(params:any)=>{
  return request(`/search/IndexSystem/DeleteSearchSystemLog`,{
    method: 'POST',
    requestType: 'form',
    data: {
      ids:params
    },
  })
}

// 获取日志开关
export const getLogSwitch=()=>{
  return request(`/search/IndexSearchInstanceCfg/GetConfigureAsync`,{
    method: 'POST',
    requestType: 'form',
    data: {
      CfgName:'',
      log_switch:'',
    },
  })
}

// 修改日志开关
export const editLogSwitch=(params:any)=>{
  return request(`/search/IndexSearchInstanceCfg/UpdateConfigureAsync`,{
    method: 'POST',
    requestType: 'form',
    data: {
      CfgName:'',
      log_switch:'',
      CfgValue:params
    },
  })
}

// 获取索引库列表
export const getIndexList=()=>{
  return request(`/search/IndexManage/GetIndexList`,{
    method:'POST',
    requestType: 'form',
    data:{
      KeyWord:'',
      IndexType:0
    }
  })
}
